package com.huping.mapper;

import com.huping.pojo.Course;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface CourseMapper {


    public List<Course> teacherCourseSelect(String userid, String courseId, String name);

    @Select("select count(*) from course where course_id = #{courseId}")
    public long getCourseNumByCourseId(String courseId);

    @Insert("insert into course (course_id,name,profile) values (#{course_id},#{name},#{profile})")
    public int courseInsert(String course_id, String name, String profile);

    @Select("select course_id,name courseName,profile from course where course_id = #{courseId}")
    public Map<String,Object> getCourseByCourseId(String courseId);

    public List<Map<String ,Object>> studentCourseSelect(String userid, String courseId, String name, String teacher);

    @Update("update course set name=#{courseName},profile=#{profile} where course_id=#{courseId}")
    public int courseUpdate(String courseId,String courseName, String profile);


}
